﻿<Window x:Class="KTVConsole2.UI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="点歌台" Loaded="Window_Loaded" Closing="Window_Closing" Icon="/KTVConsole2;component/Resource/DAIMON48X48.ico" WindowStartupLocation="Manual" WindowStyle="ThreeDBorderWindow" AllowDrop="False" ResizeMode="CanResizeWithGrip" xmlns:my="clr-namespace:System;assembly=mscorlib" Width="960" Height="600" KeyDown="Window_KeyDown" Activated="Window_Activated" Left="0" Top="0" WindowState="Maximized" >
    <Window.Resources>
        <my:Double x:Key="Opacity1">1</my:Double>
        <my:Double x:Key="Width1">560</my:Double>
        <my:Double x:Key="Width2">190</my:Double>
    </Window.Resources>
    <Window.InputBindings>
        <KeyBinding Gesture="F1" Command="Open" CommandParameter="PLAY"/>
        <KeyBinding Gesture="F2" Command="Open" CommandParameter="PLAYNEXT"/>
        <KeyBinding Gesture="F3" Command="Open" CommandParameter="FULLSCREEN"/>
        <KeyBinding Gesture="F4" Command="Open" CommandParameter="TOGGLETRACK"/>
        <KeyBinding Gesture="F8" Command="Open" CommandParameter="INPUTSEARCH"/>
        <KeyBinding Gesture="F5" Command="Open" CommandParameter="SELECTALL"/>
    </Window.InputBindings>
    <Window.CommandBindings>
        <CommandBinding Command="Open" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed"/>
    </Window.CommandBindings>

    <Viewbox Stretch="Fill">
        <Grid Background="{x:Null}" FlowDirection="LeftToRight" Opacity="{StaticResource Opacity1}">
            <Grid.RowDefinitions>
                <RowDefinition Height="70"></RowDefinition>
                <RowDefinition Height="44"></RowDefinition>
                <RowDefinition Height="582"></RowDefinition>
                <RowDefinition Height="80"></RowDefinition>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="4" Name="test" Orientation="Vertical"></StackPanel>
            <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="12" VerticalAlignment="Top">
                <Label Content="搜歌：F8" Name="label1" Width="108" FontSize="24" FontWeight="Bold"/>
                <TextBox Name="txtSearch" Width="700" CharacterCasing="Upper" FontSize="24" FontWeight="Bold" ToolTip="请输入关键字" TextChanged="txtSearch_TextChanged" TabIndex="1" PreviewKeyDown="txtSearch_PreviewKeyDown" />
                <Viewbox>
                    <CheckBox Content="歌星" Name="cbPlayer" Width="66" IsChecked="True" FontSize="20" FontWeight="Bold"  Checked="cbPlayer_Checked" HorizontalContentAlignment="Left"/>
                </Viewbox>
                <Viewbox>
                <CheckBox Content="歌曲" Name="cbSong" Width="64" IsChecked="True" FontSize="20" FontWeight="Bold"  Checked="cbSong_Checked" />
                </Viewbox>
                <StackPanel>
                    <Label Name="Version" Content="Version" Width="100"/>
                    <Label>
                        <Hyperlink NavigateUri="http://ktvconsole.codeplex.com" RequestNavigate="Hyperlink_RequestNavigate">
                            我要反馈
                        </Hyperlink>
                    </Label>
                </StackPanel>
            </StackPanel>
            <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="12">
                <ListView Name="lvPlayList" FontSize="24" MouseDoubleClick="lvPlayList_MouseDoubleClick"  TabIndex="2" IsTabStop="True" FontFamily="STXihei" SelectionChanged="lvPlayList_SelectionChanged" Width="{StaticResource Width1}" KeyDown="lvPlayList_KeyDown_1" ToolTip="按ED可以将当前选择歌曲提前或置后">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Header="点播歌曲" Width="430" DisplayMemberBinding="{Binding Path=SongName}"/>
                            <GridViewColumn Header="歌星" Width="110" DisplayMemberBinding="{Binding Path=Star}"/>
                        </GridView>
                    </ListView.View>
                </ListView>
                <Image Name="image1" Width="12" />
                <ListView ItemsSource="{Binding}" Name="lvSearch" FontSize="24" MouseDoubleClick="lvSearch_MouseDoubleClick" TabIndex="3" IsTabStop="True" FontFamily="STXihei" DataContext="{Binding}" Width="{StaticResource Width1}" GridViewColumnHeader.Click="GridViewColumnHeader_Click" KeyDown="lvSearch_KeyDown">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Header="搜索歌曲" Width="430" DisplayMemberBinding="{Binding Path=SongName}"/>
                            <GridViewColumn Header="歌星" Width="110" DisplayMemberBinding="{Binding Path=Star}"/>
                        </GridView>
                    </ListView.View>
                </ListView>
            </StackPanel>

            <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="12,0,0,0" HorizontalAlignment="Left">
                <Button Content="唱过的歌" FontSize="24" FontWeight="Bold" Name="BtnSongPlayed" Width="142" Click="BtnSongPlayed_Click" TabIndex="13" />
                <Button Content="读取列表" FontSize="24" FontWeight="Bold" Name="btnReadList" Width="142" Click="btnReadList_Click" TabIndex="14" />
                <Button Content="保存列表" FontSize="24" FontWeight="Bold" Name="btnSaveList" Width="142" Click="btnSaveList_Click" TabIndex="15" />
                <Button Content="导出..." FontSize="24" FontWeight="Bold" Name="btnExport" Width="142" TabIndex="16" Click="btnExport_Click" />
            </StackPanel>
            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,12,0">
                <Label Content="搜索结果：" Name="lblTotalCount" Width="230" FontSize="24" FontWeight="Bold" HorizontalContentAlignment="Left" Margin="0" VerticalAlignment="Bottom" />
                <Viewbox>
                <CheckBox Name="cbCanChangeToOtherWindow" Content="是否允许切换到其它窗口" FontSize="20" FontWeight="Bold" Click="cbCanChangeToOtherWindow_Click" Margin="0" Height="32" Width="246" />
                </Viewbox>
            </StackPanel>

            <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="12" HorizontalAlignment="Center">
                <Button Content="开唱/重唱F1" Name="btnPlay" Width="{StaticResource Width2}" FontSize="24" FontWeight="Bold"  TabIndex="4" Command="ApplicationCommands.Open" CommandParameter="PLAY" />

                <Button Content="切歌F2" Name="btnNext" Width="{StaticResource Width2}" FontSize="24" FontWeight="Bold"  TabIndex="5" Command="Open" CommandParameter="PLAYNEXT"/>
                <Button Content="全屏F3" Name="btnFullScreen" Width="{StaticResource Width2}" FontSize="24" FontWeight="Bold" TabIndex="6" Command="ApplicationCommands.Open" CommandParameter="fullscreen" />
                <Button Content="原唱/伴唱F4" Name="btnTrackSwitch" Width="{StaticResource Width2}" FontSize="24" FontWeight="Bold" TabIndex="7" Command="ApplicationCommands.Open" CommandParameter="toggletrack" />
                <Button Content="全选F5" Name="btnSelectAll" Width="120" FontSize="24" FontWeight="Bold" Command="ApplicationCommands.Open" CommandParameter="selectall" TabIndex="8" />
                <Button Content="增加音量" FontSize="16" FontWeight="Bold" Name="BtnVolumnUp" Width="70" Click="BtnVolumnUp_Click" TabIndex="9"/>
                <Button Content="减小音量" FontSize="16" FontWeight="Bold" Name="BtnVolumnDown" Width="70" Click="BtnVolumnDown_Click" TabIndex="10" />
                <Button Content="静音" FontSize="16" FontWeight="Bold" Name="BtnMute" Width="50" Click="BtnMute_Click_1" TabIndex="11" />
                <Button Content="配置" Name="btnConfig" Width="50" FontSize="16" FontWeight="Bold" Click="btnConfig_Click" TabIndex="12" />
            </StackPanel>
        </Grid>
    </Viewbox>

</Window>
